<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create( 'users', function ( Blueprint $table ) {
            $table->increments( 'id' );
            $table->string( 'username', 16 )->comment( '学号' );
            $table->string( 'realname', 36 )->nullable()->comment( '真实姓名' );
            $table->char( 'idcard', 18 )->nullable()->comment( '身份证号码' );
            $table->string( 'password', 64 )->comment( '密码' );
            $table->string( 'mobile', 16 )->comment( '手机号' );
            $table->string( 'openid', 64 )->comment( '微信openid' );
            $table->timestamps();
        } );
    }

    /**
     * Reverse the migrations.
     *  
     * @return void
     */
    public function down()
    {
        Schema::drop( 'users' );
    }
}
